package com.first.nell.data

data class DataInfoPageConfig(
    var apiUrl: String? = "",
    var itemCount: Int? = 0,
    var showTopTips: String? = "",
    var topTips: String? = "",
    var isContact: String? = "NO",
    var isWallet: String? = "NO",
    var contactParamName: String? = "contactList",
    var relationShips: List<List<String>>? = null,
    var dataList: List<RevObjInfoPageFieldConfig>? = mutableListOf(),
    var extDataList: List<RevObjInfoPageFieldConfig>? = mutableListOf(),
    //新增
    var pageName: String? = "",
    var pageNameSource: String? = ""
) {
    fun getFirstNellTotalFirstNellItemFirstNellCount(): Int {
        itemCount?.let {
            return it
        }
        return 0
    }

    fun isFirstNellActionFirstNellContactFirstNellGroup(): Boolean {
        return isContact.equals(
            "YES",
            true
        )
    }

    fun isFirstNellActionFirstNellWalletFirstNellGroup(): Boolean {
        return isWallet.equals(
            "YES",
            true
        )
    }

    fun getFirstNellContactFirstNellRelation(index: Int): List<DataInfoPageActionValue> {
        val list = mutableListOf<DataInfoPageActionValue>()
        relationShips?.let { gRelationShips ->
            if (gRelationShips.size > index) {
                val contents = gRelationShips[index]
                contents.forEach { item ->
                    list.add(DataInfoPageActionValue(title = item, value = item))
                }
            }
        }
        return list
    }
}